/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_master_process")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosMasterProcess.findAll", query = "SELECT p FROM PosMasterProcess p"),
//    @NamedQuery(name = "PosMasterProcess.findBySync", query = "SELECT p FROM PosMasterProcess p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosMasterProcess.findByProcessId", query = "SELECT p FROM PosMasterProcess p WHERE p.processId = :processId"),
//    @NamedQuery(name = "PosMasterProcess.findByProcessName", query = "SELECT p FROM PosMasterProcess p WHERE p.processName = :processName"),
//    @NamedQuery(name = "PosMasterProcess.findByProcessNumber", query = "SELECT p FROM PosMasterProcess p WHERE p.processNumber = :processNumber"),
//    @NamedQuery(name = "PosMasterProcess.findByProcessTotal", query = "SELECT p FROM PosMasterProcess p WHERE p.processTotal = :processTotal"),
//    @NamedQuery(name = "PosMasterProcess.findByProcessCost", query = "SELECT p FROM PosMasterProcess p WHERE p.processCost = :processCost"),
//    @NamedQuery(name = "PosMasterProcess.findByProcessGrandTotal", query = "SELECT p FROM PosMasterProcess p WHERE p.processGrandTotal = :processGrandTotal")})
public class PosMasterProcess implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "process_id")
    private Integer processId;
    @Column(name = "process_name")
    private String processName;
    @Column(name = "process_number")
    private String processNumber;
    @Column(name = "process_total")
    private BigDecimal processTotal;
    @Column(name = "process_cost")
    private BigDecimal processCost;
    @Column(name = "process_grand_total")
    private BigDecimal processGrandTotal;
    @Lob
    @Column(name = "process_description")
    private String processDescription;
    
    @JoinColumn(name = "process_item_id", referencedColumnName = "item_id")
    @ManyToOne
    private PosMasterItem processItemId;

    public PosMasterProcess() {
    }

    public PosMasterProcess(Integer processId) {
        this.processId = processId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getProcessId() {
        return processId;
    }

    public void setProcessId(Integer processId) {
        this.processId = processId;
    }

    public String getProcessName() {
        return processName;
    }

    public void setProcessName(String processName) {
        this.processName = processName;
    }

    public String getProcessNumber() {
        return processNumber;
    }

    public void setProcessNumber(String processNumber) {
        this.processNumber = processNumber;
    }

    public BigDecimal getProcessTotal() {
        return processTotal;
    }

    public void setProcessTotal(BigDecimal processTotal) {
        this.processTotal = processTotal;
    }

    public BigDecimal getProcessCost() {
        return processCost;
    }

    public void setProcessCost(BigDecimal processCost) {
        this.processCost = processCost;
    }

    public BigDecimal getProcessGrandTotal() {
        return processGrandTotal;
    }

    public void setProcessGrandTotal(BigDecimal processGrandTotal) {
        this.processGrandTotal = processGrandTotal;
    }

    public String getProcessDescription() {
        return processDescription;
    }

    public void setProcessDescription(String processDescription) {
        this.processDescription = processDescription;
    }

    public PosMasterItem getProcessItemId() {
        return processItemId;
    }

    public void setProcessItemId(PosMasterItem processItemId) {
        this.processItemId = processItemId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (processId != null ? processId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosMasterProcess)) {
            return false;
        }
        PosMasterProcess other = (PosMasterProcess) object;
        if ((this.processId == null && other.processId != null) || (this.processId != null && !this.processId.equals(other.processId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return processName;
//        return "com.ronsicecream.pos.entities.PosMasterProcess[ processId=" + processId + " ]";
    }
    
}
